﻿<%@ Page Title="" Language="C#" MasterPageFile="~/App_MasterPages/layout.Master" AutoEventWireup="true" CodeBehind="RSEstimateReport.aspx.cs" Inherits="mojoPortal.Web.RS.SBM.RSEstimateReport" %>
<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<%@ Register Src="controls/locationheadercontrol.ascx" TagName="LocationHeaderControl" TagPrefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="leftContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="mainContent" runat="server">

<uc1:LocationHeaderControl ID="ucLocationHeaderControl" runat="server"/>

<asp:UpdatePanel ID="upnlEstimateReport" runat="server">
<ContentTemplate>

<div>
<table>
<tr>
<td valign="top" nowrap>EstimateID:</td>
<td>
    <asp:DropDownList ID="ddlEstimateId" runat="server" AppendDataBoundItems="True" AutoPostBack="false" Width="130px">
    <asp:ListItem Text="< Please Select >" Value=""></asp:ListItem>
    </asp:DropDownList>
    <asp:Button ID="btnRunReport" runat="server" Text="Run Report" OnClick="btnRunReport_Click"/>
    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Required" ControlToValidate="ddlEstimateId" ForeColor="Red" ></asp:RequiredFieldValidator>          
    &nbsp;&nbsp;
    <asp:Button ID="btnReturn" runat="server" Text="Return" OnClick="btnReturn_Click"/>
</td>
</tr>
</table>
<table width="100%">
<tr>
    <td>
        <rsweb:ReportViewer ID="ReportViewer1" runat="server" Height="800px" 
        Width="100%" Font-Names="Verdana" Font-Size="8pt" 
        WaitMessageFont-Names="Verdana" 
        WaitMessageFont-Size="14pt">
        <LocalReport ReportPath="RS\AppData\SBM\Reports\RDLC\RSEstimateReport.rdlc">
            <DataSources>
                <rsweb:reportdatasource name="vwEstimate" 
                    DataSourceId="EstimateObjectDataSource" />
                <rsweb:reportdatasource name="vwEstimateItem" 
                    DataSourceId="EstimateItemObjectDataSource" />
                <rsweb:reportdatasource name="tblCompany"
                    DataSourceId="CompanyObjectDataSource" />                                                                                           
            </DataSources>
        </LocalReport>
        </rsweb:ReportViewer>
    </td>
</tr>
</table>
      


<asp:ObjectDataSource ID="EstimateObjectDataSource" runat="server" 
    OldValuesParameterFormatString="original_{0}" 
    SelectMethod="GetEstimateData" 
    TypeName="mojoPortal.Web.RS.AppData.SBM.Reports.RSEstimateDatasetTableAdapters.vw_EstimateTableAdapter"
    OnObjectCreated="ObjectDataSource_OnObjectCreated" >
    <SelectParameters>
        <asp:Parameter Name="EstimateId" Type="Int64" />
        <asp:SessionParameter Name="CompanyId" SessionField="CompanyID" Type="Int64" />
    </SelectParameters>
</asp:ObjectDataSource>      
<asp:ObjectDataSource ID="EstimateItemObjectDataSource" runat="server" 
    OldValuesParameterFormatString="original_{0}" 
    SelectMethod="GetEstimateItemData" 
    TypeName="mojoPortal.Web.RS.AppData.SBM.Reports.RSEstimateDatasetTableAdapters.vw_EstimateItemTableAdapter"
    OnObjectCreated="ObjectDataSource_OnObjectCreated" >
    <SelectParameters>
        <asp:Parameter Name="EstimateId" Type="Int64" />
        <asp:SessionParameter Name="CompanyId" SessionField="CompanyID" Type="Int64" />
    </SelectParameters>
</asp:ObjectDataSource>       
<asp:ObjectDataSource ID="CompanyObjectDataSource" runat="server" 
    OldValuesParameterFormatString="original_{0}" SelectMethod="GetCompanyData" 
    TypeName="mojoPortal.Web.RS.AppData.SBM.Reports.RSEstimateDatasetTableAdapters.rs_tblCompanyTableAdapter"
    OnObjectCreated="ObjectDataSource_OnObjectCreated" >
    <SelectParameters>
        <asp:SessionParameter Name="CompanyId" SessionField="CompanyId" Type="Int64" />
    </SelectParameters>
</asp:ObjectDataSource>
       
    </div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="rightContent" runat="server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="pageEditContent" runat="server">
</asp:Content>
